home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / infor / tsptp.zip / TSCRN.PAS < prev    next >
Pascal/Delphi Source File  |  1993-04-09  |  2KB  |  62 lines

  1. (******************************************************************************)
  2. (*                                 TSCRN.PAS                                  *)
  3. (*                           Screen Write Benchmark.                          *)
  4. (******************************************************************************)
  5.  
  6. PROGRAM Tscrn(Output);
  7.  
  8. (******************************************************************************)
  9. (*                                TIMING                                      *)
  10. (******************************************************************************)
  11.  
  12. (*$IFNDEF TopSpeed *)
  13.  (*%F TRUE   *** Compile for Turbo Pascal ***)
  14.   USES TPBench;
  15.  (*%E*)
  16. (*$ELSE     *** Compile for TopSpeed Pascal ***)
  17.   IMPORT TSBench *;
  18. (*$ENDIF *)
  19.  
  20. (******************************************************************************)
  21.  
  22.   PROCEDURE TextScrn;
  23.     VAR I : BmInt;
  24.   BEGIN
  25.  
  26.     FOR I := 1 TO 1000 DO
  27.       WriteLn('(', I:5, ') 1234567890qwertyuiop');
  28.  
  29.   END;
  30.  
  31. BEGIN
  32.   WriteLn('TextScrn Benchmark');
  33.  
  34. (******************************************************************************)
  35. (*  Compute the looping overhead.  The Dummy procedure must have some side-   *)
  36. (*  effect so that it is not optimised out of existence.                      *)
  37. (******************************************************************************)
  38.  
  39.   StartTimer;                                   (* Start the clock.           *)
  40.  
  41.   REPEAT
  42.     Dummy;
  43.   UNTIL NullTimesUp;
  44.  
  45. (******************************************************************************)
  46. (*  Now run the benchmark.  Note that the Dummy procedure is also called so   *)
  47. (*  that we can eliminate its overhead from the looping overhead.             *)
  48. (******************************************************************************)
  49.  
  50.   StartTimer;                                   (* Start the clock.           *)
  51.  
  52.   REPEAT
  53.     TextScrn;
  54.     Dummy
  55.   UNTIL BenchTimesUp;
  56.  
  57. (******************************************************************************)
  58.  
  59.   ReportTimes;
  60.  
  61. END.
  62.